<template>
  <a-modal
    :width="1400"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-tabs>
      <a-tab-pane
              loading="true"
              tab="项目详情"
              :key="formInfo.id+1">
        <a-descriptions :title="formInfo.title">
          <a-descriptions-item label="编号">{{ formInfo.no }}</a-descriptions-item>
          <a-descriptions-item label="名称">{{ formInfo.name }}</a-descriptions-item>
          <a-descriptions-item label="年度">{{ formInfo.year }}</a-descriptions-item>
          <a-descriptions-item label="项目类别">{{ this.$sysDictFilter(formInfo.types, 'repairType')  }}</a-descriptions-item>
          <a-descriptions-item label="项目分类">{{  formInfo.equTypeName }}</a-descriptions-item>
          <a-descriptions-item label="地点">{{ formInfo.buildings==undefined?formInfo.campusAddress:formInfo.buildings }}{{ formInfo.address }}</a-descriptions-item>

          <a-descriptions-item label="可研评审文号" :span="2">{{ formInfo.fsReviewNumber }}</a-descriptions-item>
          <a-descriptions-item label="可研批复时间">{{ formInfo.fsAppTime }}</a-descriptions-item>
          <a-descriptions-item label="可研批复文号" :span="2">{{ formInfo.fsAppNumber }}</a-descriptions-item>
          <a-descriptions-item label="可研批复估算">{{ formInfo.fsAppEst }}</a-descriptions-item>
          <a-descriptions-item label="初设评审文号" :span="2">{{ formInfo.priReviewNumber }}</a-descriptions-item>
          <a-descriptions-item label="初设批复时间">{{ formInfo.priAppTime }}</a-descriptions-item>
          <a-descriptions-item label="初设批复文号" :span="2">{{ formInfo.priAppNumber }}</a-descriptions-item>
          <a-descriptions-item label="初设批复估算">{{ formInfo.priAppEst }}</a-descriptions-item>
          <a-descriptions-item label="可研建设必要性" :span="3">{{ formInfo.fsremark }}</a-descriptions-item>
          <a-descriptions-item label="可研内容" :span="3">{{ formInfo.fsContent }}</a-descriptions-item>
          <a-descriptions-item label="初设内容" :span="3">{{ formInfo.priContent }}</a-descriptions-item>
        </a-descriptions>
      </a-tab-pane>
      <a-tab-pane
              loading="true"
              tab="维修明细"
              :key="formInfo.id+2">
          <equ-repair-deail-list :repairid="formInfo.id"></equ-repair-deail-list>
      </a-tab-pane>
    </a-tabs>

  </a-modal>
</template>

<script>
  import pick from 'lodash.pick'
  import { getAction } from '@/api/manage'
  import EquRepairDeailList from "../equRepairDeail/EquRepairDeailList";

  export default {
    name: 'EquRepairView',
    components: {EquRepairDeailList},
    data () {
      return {
        visible: false,
        confirmLoading: false,
        formInfo: {},
        url: {
          saveInfo: '/system/equRepair/save',
          getInfo: '/system/equRepair/info'
        }
      }
    },
    created () {
    },
    methods: {
      show (record) {
        this.formInfo = Object.assign({}, record)

        this.visible = true
      },
                                                                                                                                                                                                                                      // 确定
      handleSubmit () {
        this.visible = false
      },
      // 关闭
      handleCancel () {
        this.close()
      },
      close () {
        this.visible = false
      }
    }
  }
</script>
